﻿
namespace NetTao.Builder
{
    public class BuilderBase
    {
        protected string ReplaceInvalidValue(int flag,string dest)
        {
            string result = dest;
            switch (flag)
            {
                case 1:
                    {
                        result = result.Replace("&", "&amp;");
                        result = result.Replace("<", "&gt;");
                        result = result.Replace(">", "&lt;");
                        result = result.Replace("\n", "");
                        result = result.Replace("\r", "");
                    }
                    break;
                case 2:
                    {
                        result = result.Replace("\r", "");
                        result = result.Replace("\n\n", "\n");
                        result = result.Replace("\n", "<br /><br />");
                    }
                    break;
            }
            return result;
        }
    }
}
